import request from '@/utils/request'

//获取员工列表接口
export function getEmployeeList(params) {
    return request({
        url: '/sys/user',
        params  //查询参数
    })
}
//删除员工列表接口
export function deltEmployee(id) {
    return request({
        url: `/sys/user/${id}`,
        methods: 'DELETE',
    })
}
//新增员工接口
export function addEmployee(data) {
    return request({
        url: "/sys/user",
        methods: 'post',
        data
    })
}
//获取员工详情
export function getEmployeeDetail(id) {
    return request({
        url: `/sys/user/${id}`
    })
}
//更新员工数据
export function updateEmployee(data) {
    return request({
        url: `/sys/user/${data.id}`,
        method: 'put',
        data
    })
}
//获取可用的角色
export function getEnableRoleList() {
    return request({
        url: '/sys/role/list/enabled'
    })
}
//重新分配员工角色
export function assignRole(data) {
    return request({
        url: '/sys/user/assignRoles',
        method: 'put',
        data
    })
}